package com.andy.buyu.server.dto;

import com.andy.buyu.server.game.GameUser;

import io.netty.buffer.ByteBuf;

/**
 * 炮弹攻击
 * @author cuiwm
 */
public class AttackMessage extends BaseMessage{
	
	private GameUser user;
	private int battery;
	private int x;
	private int y;
	private int lostCoin;
    
    public AttackMessage(GameUser user,int battery,int lostCoin,int x,int y) {
    	this.user = user;
    	this.battery = battery;
    	this.lostCoin = lostCoin;
    	this.x = x;
    	this.y = y;
	}

	@Override
	public void writeBody(ByteBuf buf) {
		writeString(buf, user.getId().toString());
		buf.writeByte(battery);
		buf.writeInt(lostCoin);
		buf.writeInt(x);
		buf.writeInt(y);
	}


}